package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Invmb;
import com.clouds.wms.dao.InvmaDao;
import com.clouds.wms.dao.SalmaDao;
import com.clouds.wms.dao.InvmbDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("invmbService")
public class InvmbServiceImpl implements InvmbService {
	@Resource(name="invmbDao")
	private InvmbDao invmbDao;
	@Resource(name="invmaDao")
	private InvmaDao invmaDao;

	@Override
	public PagesBean getInvmbList(String maaa, String maab, int offset,	int pageSize) throws SysException {
		return invmbDao.getInvmbList(maaa, maab, offset, pageSize);
	}

	@Override
	public int saveInvmb(Invmb invmb) throws SysException {
		return invmbDao.saveInvmb(invmb);
	}

	@Override
	public int getMaxMbac() throws SysException {
		return invmbDao.getMaxMbac();
	}

	@Override
	public int delInvmb(String mbaa, String mbab, String mbacs)	throws SysException {
		return invmbDao.delInvmb(mbaa, mbab, mbacs);
	}

	@Override
	public int updateInvmb(Invmb invmb) throws SysException {
		return invmbDao.updateInvmb(invmb);
	}

	@Override
	public int changeStatus(String mbaa, String mbab, String status)throws SysException {
		return invmbDao.changeStatus(mbaa, mbab, status);
	}

	@Override
	public void delInvmamb(String maaa, String maab) throws SysException {
		invmaDao.delInvmaByAaAb(maaa, maab);
		invmbDao.delInvmbByAaAb(maaa, maab);
	}

	@Override
	public void delInvmbAll(String maaa, String maab) throws SysException {
		invmbDao.delInvmbByAaAb(maaa, maab);
	}
}
